package cn.weiyang.biz;

import cn.weiyang.model.Emp;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 完成员工的增删改查操作
 * Created by Administrator on 2017/7/14.
 */
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true,rollbackFor = RuntimeException.class)
public interface EmpBiz {
    @Transactional(propagation = Propagation.REQUIRED)
    public void addEmp(Emp emp);
    @Transactional(propagation = Propagation.REQUIRED)
    public void delEmp(int empid);
    @Transactional(propagation = Propagation.REQUIRED)
    public void updateEmp(Emp emp);

    public Emp get(int empid);

    public List<Emp> searchEmp(Emp emp);

    public List<Emp> searchEmp(String hql);
    @Transactional(propagation = Propagation.REQUIRED)
    public void addEmps(List<Emp> emps) throws Exception;
}
